package com.fengmi.controller;

import com.fengmi.dto.PageDTO;
import com.fengmi.entity.CmsContentCat;
import com.fengmi.service.ContentService;
import com.fengmi.vo.PageResultVO;
import com.fengmi.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 123
 * @Date 2022/1/24 21:11
 * @Version 1.0
 */

@RestController
@CrossOrigin
@RequestMapping("content")
@Api(tags = "内容管理")
public class ContentController {

    @Autowired
    private ContentService contentService;


    @PostMapping("page")
    @ApiOperation("内容分类分页查询")
    public PageResultVO<CmsContentCat> page(@RequestBody PageDTO<CmsContentCat> pageDTO) {
        return contentService.findContentCategoryByPage(pageDTO);
    }

    @PostMapping("update")
    @ApiOperation("修改内容分类信息")
    public ResultVO update(@RequestBody CmsContentCat cmsContentCat ) {
        return contentService.updateContent(cmsContentCat);
    }

}
